package com.toby.demo.quickfixj.sender;

import java.util.Date;

import quickfix.Application;
import quickfix.DoNotSend;
import quickfix.FieldNotFound;
import quickfix.IncorrectDataFormat;
import quickfix.IncorrectTagValue;
import quickfix.Message;
import quickfix.RejectLogon;
import quickfix.SessionID;
import quickfix.UnsupportedMessageType;

public class FIXSender implements Application {

	public void fromAdmin(Message message, SessionID sessionID)
			throws FieldNotFound, IncorrectDataFormat, IncorrectTagValue,
			RejectLogon {
		System.out.println("Tobby Sender fromAdmin.. message: " + message + ", sessionID: " + sessionID);
	}

	public void fromApp(Message message, SessionID sessionID)
			throws FieldNotFound, IncorrectDataFormat, IncorrectTagValue,
			UnsupportedMessageType {
		System.out.println("Tobby Sender fromApp.. message: " + message + ", sessionID: " + sessionID);
	}

	public void onCreate(SessionID sessionID) {
		System.out.println("Tobby Sender onCreate.. sessionID: " + sessionID);
	}

	public void onLogon(SessionID sessionID) {
		System.out.println("Tobby Sender onLogon.. sessionID: " + sessionID);
	}

	public void onLogout(SessionID sessionID) {
		System.out.println("Tobby Sender onLogout.. sessionID: " + sessionID);
	}

	public void toAdmin(Message message, SessionID sessionID) {
		System.out.println("Tobby Sender toAdmin.. sessionID: " + sessionID);
	}

	public void toApp(Message message, SessionID sessionID) throws DoNotSend {
		System.out.println("Tobby Sender toApp.. time: " + new Date().toString() + " message: " + message.toString());
	}

}
